<?php
/*
 * Copyright (c) 2017-2025 Tencent. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
namespace TencentCloud\Tdmq\V20200217\Models;
use TencentCloud\Common\AbstractModel;

/**
 * ReceiveMessage response structure.
 *
 * @method string getMessageID() Obtain Unique primary key used to identify the message
 * @method void setMessageID(string $MessageID) Set Unique primary key used to identify the message
 * @method string getMessagePayload() Obtain Content of the received message
 * @method void setMessagePayload(string $MessagePayload) Set Content of the received message
 * @method string getAckTopic() Obtain Provided to the `Ack` API and used to acknowledge messages in the topic
 * @method void setAckTopic(string $AckTopic) Set Provided to the `Ack` API and used to acknowledge messages in the topic
 * @method string getErrorMsg() Obtain Returned error message. If it is null, it means there is no error.
 * @method void setErrorMsg(string $ErrorMsg) Set Returned error message. If it is null, it means there is no error.
 * @method string getSubName() Obtain Returned subscriber names, used for creating Ack consumers
 * @method void setSubName(string $SubName) Set Returned subscriber names, used for creating Ack consumers
 * @method string getMessageIDList() Obtain BatchReceivePolicy specifies the messageids of multiple messages returned at one time, using '###' to distinguish different messageids.
 * @method void setMessageIDList(string $MessageIDList) Set BatchReceivePolicy specifies the messageids of multiple messages returned at one time, using '###' to distinguish different messageids.
 * @method string getMessagesPayload() Obtain BatchReceivePolicy specifies the message content of multiple messages returned at one time, using '###' to distinguish different message content.
 * @method void setMessagesPayload(string $MessagesPayload) Set BatchReceivePolicy specifies the message content of multiple messages returned at one time, using '###' to distinguish different message content.
 * @method string getRequestId() Obtain The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.
 * @method void setRequestId(string $RequestId) Set The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.
 */
class ReceiveMessageResponse extends AbstractModel
{
    /**
     * @var string Unique primary key used to identify the message
     */
    public $MessageID;

    /**
     * @var string Content of the received message
     */
    public $MessagePayload;

    /**
     * @var string Provided to the `Ack` API and used to acknowledge messages in the topic
     */
    public $AckTopic;

    /**
     * @var string Returned error message. If it is null, it means there is no error.
     */
    public $ErrorMsg;

    /**
     * @var string Returned subscriber names, used for creating Ack consumers
     */
    public $SubName;

    /**
     * @var string BatchReceivePolicy specifies the messageids of multiple messages returned at one time, using '###' to distinguish different messageids.
     */
    public $MessageIDList;

    /**
     * @var string BatchReceivePolicy specifies the message content of multiple messages returned at one time, using '###' to distinguish different message content.
     */
    public $MessagesPayload;

    /**
     * @var string The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.
     */
    public $RequestId;

    /**
     * @param string $MessageID Unique primary key used to identify the message
     * @param string $MessagePayload Content of the received message
     * @param string $AckTopic Provided to the `Ack` API and used to acknowledge messages in the topic
     * @param string $ErrorMsg Returned error message. If it is null, it means there is no error.
     * @param string $SubName Returned subscriber names, used for creating Ack consumers
     * @param string $MessageIDList BatchReceivePolicy specifies the messageids of multiple messages returned at one time, using '###' to distinguish different messageids.
     * @param string $MessagesPayload BatchReceivePolicy specifies the message content of multiple messages returned at one time, using '###' to distinguish different message content.
     * @param string $RequestId The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.
     */
    function __construct()
    {

    }

    /**
     * For internal only. DO NOT USE IT.
     */
    public function deserialize($param)
    {
        if ($param === null) {
            return;
        }
        if (array_key_exists("MessageID",$param) and $param["MessageID"] !== null) {
            $this->MessageID = $param["MessageID"];
        }

        if (array_key_exists("MessagePayload",$param) and $param["MessagePayload"] !== null) {
            $this->MessagePayload = $param["MessagePayload"];
        }

        if (array_key_exists("AckTopic",$param) and $param["AckTopic"] !== null) {
            $this->AckTopic = $param["AckTopic"];
        }

        if (array_key_exists("ErrorMsg",$param) and $param["ErrorMsg"] !== null) {
            $this->ErrorMsg = $param["ErrorMsg"];
        }

        if (array_key_exists("SubName",$param) and $param["SubName"] !== null) {
            $this->SubName = $param["SubName"];
        }

        if (array_key_exists("MessageIDList",$param) and $param["MessageIDList"] !== null) {
            $this->MessageIDList = $param["MessageIDList"];
        }

        if (array_key_exists("MessagesPayload",$param) and $param["MessagesPayload"] !== null) {
            $this->MessagesPayload = $param["MessagesPayload"];
        }

        if (array_key_exists("RequestId",$param) and $param["RequestId"] !== null) {
            $this->RequestId = $param["RequestId"];
        }
    }
}
